Use following command to install GCC MIPS compiler on ubuntu:
sudo apt-get install gcc-mipsel-linux-gnu
run mipsel-linux-gnu-gcc -g -c myprog.c to produce an object file myprog.o that contains debugging information. Then view the disassembly of the object file using mipsel-linux-gnu-objdump -d -S myprog.o.